package swg;

import java.util.ArrayList;

import swg.shape.Branch;
import swg.shape.BranchOLD;
import swg.shape.Circle;
import swg.shape.Color;
import swg.shape.IswgShape;
import swg.shape.Point;
import swg.shape.Polyline;
import swg.shape.Text;
import swg.shape.Tree;
import swg.utils.RunningTime;

public class Draw
{

	/**
	 * @param args
	 */
	private static String standardPath = "c:/tmp/svg/";

	public static void main(String[] args)
	{
		// test();
		// spiral();
		// spiralLine();
		// fillSquare1();
		// fillSquare2();
		// fillSquare3();
		// randomWalk();
		// randomWalk();
		// trees();
		// trees_2();
		// angles();
		// midPoint();
		// pitagoraTree();
		// pitagoraTreeSteps();

		// matrix();
		mandelbrot();

		//Koch();
		
		//Hilbert();

	}

	private static void mandelbrot()
	{
		// TODO Auto-generated method stub
		
	}

	private static void Hilbert()
	{

		ArrayList<IswgShape> shapes = new ArrayList<IswgShape>();
		Point p1 = new Point(100, 400);
		Point p2 = new Point(400, 400);
		ArrayList<Point> poly = new ArrayList<Point>();
		ArrayList<ArrayList<Point>> steps = new ArrayList<ArrayList<Point>>();
		poly.add(p1);
		poly.add(p2);
		steps.add(poly);

		int nPoints = 5;

		

		ArrayList<Point> poly1 = Point.getHilbertCurve(p1,p2);
		
		steps.add(poly1);

		int iteractions =3;

		for (int i = 1; i < iteractions; i++)
		{
			ArrayList<Point> polyN = steps.get(i - 1);

			ArrayList<Point> polyNext = new ArrayList<Point>();
			for (int j = 0; j < polyN.size() - 1; j++)
			{

				Point p11 = polyN.get(j);
				Point p22 = polyN.get(j + 1);				

				ArrayList<Point> polyStep = Point.getHilbertCurve(p11,p22);

				polyNext.addAll(polyStep);
				nPoints = nPoints + 5;
			}
			System.out.println(i + " points:" + nPoints);
			steps.add(polyNext);
		}
		
		for (int i = steps.size()-1; i < steps.size();i++)
		{
			System.out.println("add: "+i);
			Color color1 =new Color(200-i*10);
			Polyline polyline0 = new Polyline("fill:none;stroke-width:1;stroke:" + color1.getSWGCode(), steps.get(i));
			polyline0.setCaps(true);
			shapes.add(polyline0);
		}

		MakeSVGFile makeSVGFile = new MakeSVGFile(standardPath + "Hilbert" + iteractions + ".svg", shapes);
		makeSVGFile.process();

		System.out.println("byE");
	}

	private static void Koch()
	{

		ArrayList<IswgShape> shapes = new ArrayList<IswgShape>();
		Point p1 = new Point(-100, 500);
		Point p2 = new Point(1600, 500);
		ArrayList<Point> poly = new ArrayList<Point>();
		ArrayList<ArrayList<Point>> steps = new ArrayList<ArrayList<Point>>();
		poly.add(p1);
		poly.add(p2);
		steps.add(poly);

		int nPoints = 5;

		

		ArrayList<Point> poly1 = p1.getKochCurve(p2);
		
		steps.add(poly1);

		int iteractions = 13;

		for (int i = 1; i < iteractions; i++)
		{
			ArrayList<Point> polyN = steps.get(i - 1);

			ArrayList<Point> polyNext = new ArrayList<Point>();
			for (int j = 0; j < polyN.size() - 1; j++)
			{

				Point p11 = polyN.get(j);
				Point p22 = polyN.get(j + 1);				

				ArrayList<Point> polyStep = p11.getKochCurve(p22);

				polyNext.addAll(polyStep);
				nPoints = nPoints + 5;
			}
			System.out.println(i + " points:" + nPoints);
			steps.add(polyNext);
		}
		
		for (int i = steps.size()-1; i < steps.size();i++)
		{
			System.out.println("add: "+i);
			Color color1 =new Color(200-i*10);
			Polyline Polyline0 = new Polyline("fill:none;stroke-width:1;stroke:" + color1.getSWGCode(), steps.get(i));
			shapes.add(Polyline0);
		}

		MakeSVGFile makeSVGFile = new MakeSVGFile(standardPath + "Koch" + iteractions + ".svg", shapes);
		makeSVGFile.process();

		System.out.println("byE");
	}

	private static void matrix()
	{
		Point[][] matrix = new Point[20][20];
		ArrayList<IswgShape> shapes = new ArrayList<IswgShape>();

		for (int i = 0; i < 20; i++)
		{
			for (int j = 0; j < 20; j++)
			{
				int step = 2;
				Color c = new Color(i * 10, 0, j * 10);
				Point p0 = new Point(i * step + 20, j * step + 20, "fill:" + c.getSWGCode());
				p0.setR(2);
				matrix[i][j] = p0;
			}
		}

		Point[][] matrixOut = new Point[20][20];
		for (int i = 0; i < 20; i++)
		{
			for (int j = 0; j < 20; j++)
			{
				Point p = matrix[i][j];
				int x = p.getX() * p.getX() / 15 - p.getX() * 10 + 500;
				int y = p.getY() * p.getY() / 15 - p.getX() * 10 + 600;
				Point pp = new Point(x, y, p.getStyle());
				matrixOut[i][j] = pp;
			}
		}

		for (int i = 0; i < 20; i++)
		{
			for (int j = 0; j < 20; j++)
			{
				shapes.add(matrix[i][j]);
				shapes.add(matrixOut[i][j]);
			}
		}
		MakeSVGFile makeSVGFile = new MakeSVGFile(standardPath + "matrix1.svg", shapes);
		makeSVGFile.process();

		System.out.println("byE");

	}

	private static void pitagoraTreeSteps()
	{
		for (int step = 1; step < 25; step++)
		{
			pitagoraTreeSingle(step);
		}
	}

	private static void pitagoraTreeSingle(int step)
	{

		RunningTime rt1 = new RunningTime();
		rt1.start();
		ArrayList<IswgShape> shapes = new ArrayList<IswgShape>();
		// stroke:black;stroke-width:3
		Point p1 = new Point(200, 600);
		Point p2 = new Point(500, 600);
		ArrayList<Point> poly = new ArrayList<Point>();
		ArrayList<ArrayList<Point>> steps = new ArrayList<ArrayList<Point>>();
		poly.add(p1);
		poly.add(p2);
		steps.add(poly);
		Color color = new Color(0, 0, 0);
		Polyline p0 = new Polyline("fill:none;stroke-width:1;stroke:" + color.getSWGCode(), poly);
		shapes.add(p0);

		for (int s = 1; s < step; s++)
		{

			RunningTime rt = new RunningTime();
			rt.start();

			ArrayList<Point> polyN = new ArrayList<Point>();
			ArrayList<Point> polyBefore = steps.get(s - 1);
			int points = 0;
			for (int i = 0; i < polyBefore.size() - 1; i++)
			{
				Point a = polyBefore.get(i);
				Point b = polyBefore.get(i + 1);
				Point c = b.getMiddlePoint(a);
				polyN.add(a);
				polyN.add(c);
				polyN.add(b);
				points++;
			}
			steps.add(polyN);
			rt.stop();
			System.out.println("step: " + s + " points: " + points + " time:" + rt.getElapsedDescr());
		}

		Polyline pn = new Polyline("fill:none;stroke-width:1;stroke:" + color.getSWGCode(), steps.get(steps.size() - 1));
		shapes.add(pn);
		MakeSVGFile makeSVGFile = new MakeSVGFile(standardPath + "pitagoraTreeSingle_" + step + ".svg", shapes);
		makeSVGFile.process();

		rt1.stop();
		System.out.println("byE  time:" + rt1.getElapsedDescr());

	}

	private static void pitagoraTree(int step)
	{

		ArrayList<IswgShape> shapes = new ArrayList<IswgShape>();
		// stroke:black;stroke-width:3
		Point p1 = new Point(200, 600);
		Point p2 = new Point(500, 600);
		ArrayList<Point> poly = new ArrayList<Point>();
		ArrayList<ArrayList<Point>> steps = new ArrayList<ArrayList<Point>>();
		poly.add(p1);
		poly.add(p2);
		steps.add(poly);
		Color color = new Color(0, 0, 0);
		Polyline p0 = new Polyline("fill:none;stroke-width:1;stroke:" + color.getSWGCode(), poly);
		shapes.add(p0);

		for (int s = 1; s < step; s++)
		{
			ArrayList<Point> polyN = new ArrayList<Point>();
			ArrayList<Point> polyBefore = steps.get(s - 1);
			int points = 0;
			for (int i = 0; i < polyBefore.size() - 1; i++)
			{
				Point a = polyBefore.get(i);
				Point b = polyBefore.get(i + 1);
				Point c = b.getMiddlePoint(a);
				polyN.add(a);
				polyN.add(c);
				polyN.add(b);
				points++;
			}
			steps.add(polyN);
			Color colorN = new Color(s * 10);
			Polyline pn = new Polyline("fill:none;stroke-width:1;stroke:" + colorN.getSWGCode(), polyN);
			shapes.add(pn);
			System.out.println("step: " + s + " points: " + points);
		}

		MakeSVGFile makeSVGFile = new MakeSVGFile(standardPath + "pitagoraTree_" + step + ".svg", shapes);
		makeSVGFile.process();

		System.out.println("byE ");

	}

	private static void midPoint()
	{
		String style1 = "fill:red;";
		String style3 = "fill:blue;";
		// Point p1=new Point(70, 30,style1);
		// Point p2= new Point (130,70,style1);

		Point p1 = new Point(70, 70, style1);
		Point p2 = new Point(130, 70, style1);

		Point p0 = p1.getMiddlePoint(p2);
		p0.setStyle(style3);

		ArrayList<IswgShape> shapes = new ArrayList<IswgShape>();
		shapes.add(p1);
		shapes.add(p2);
		shapes.add(p0);

		MakeSVGFile makeSVGFile = new MakeSVGFile(standardPath + "midPointN.svg", shapes);
		makeSVGFile.process();
		System.out.println("byE ");
	}

	private static void angles()
	{
		Point o = new Point(200, 200);
		ArrayList<IswgShape> shapes = new ArrayList<IswgShape>();
		for (double degree = 0; degree < 2 * Math.PI; degree = degree + Math.PI / 8)
		{
			Point n = new Point(150, degree, o.getX(), o.getY());
			Branch nn = new Branch(o, n);
			nn.setStyleColor(new Color(200, 200, 200));
			Text t = new Text(n.getX(), n.getY(), degree + "");
			shapes.add(nn);
			shapes.add(t);
		}

		MakeSVGFile makeSVGFile = new MakeSVGFile(standardPath + "anglesRad.svg", shapes);
		makeSVGFile.process();
		System.out.println("byE ");

	}

	private static void trees_2()
	{
		Point start = new Point(500, 530);
		Point end = new Point(500, 500);

		Branch trunk = new Branch(start, end);
		Tree tree = new Tree(trunk);

		tree.setStyleColor(new Color(0, 0, 0));
		tree.setStyleStrike(2);
		tree.setCaps(false);
		tree.setStyleCapsColor(new Color(255, 0, 0));
		tree.setStyleCapsRadius(2);
		tree.setTxt(Math.toDegrees(tree.getPhi()) + "");
		double nBranches = (Math.PI * 1 + 3);
		double branchesAngle = Math.PI / 1.5;

		// double kk=-nBranches;
		// double kkPhi=0.5;
		int nLevel = 6;
		// double costPhi=0;
		// double kRho=10;

		int nBr = 0;

		// first level
		double rho1 = 30;
		ArrayList<Branch> newLevel = new ArrayList<Branch>();
		for (int b = 0; b < nBranches; b++)
		{
			Point startN = tree.getStart().getEnd();
			double phi = tree.getPhi() - (b * branchesAngle / (nBranches - 1)) + branchesAngle / 2;// +startN.getPhi();
			System.out.println(b + ") " + (Math.toDegrees(phi)));
			Point endN = new Point(rho1, phi, startN.getX(), startN.getY());
			Branch newBranch = new Branch(startN, endN);
			newBranch.setStyleColor(new Color(0, 0, 0));
			newBranch.setStyleStrike(1);
			newBranch.setCaps(false);
			newBranch.setStyleCapsColor(new Color(255, 0, 0));
			newBranch.setStyleCapsRadius(1);
			newLevel.add(newBranch);
			nBr++;
		}
		tree.getBranches().put(1, newLevel);

		for (int level = 2; level < nLevel; level++)
		{
			ArrayList<Branch> firstLevelBrenches = tree.getBranches().get(level - 1);
			ArrayList<Branch> nextLevel = new ArrayList<Branch>();
			int nBranch = 1;
			for (Branch branch : firstLevelBrenches)
			{
				int nBranchesN = (int) (Math.random() * nBranches * 4 - nBranches);
				// branch=firstLevelBrenches.get(0);
				double rhoN = rho1 + Math.random() * rho1;
				for (int b = 0; b < nBranchesN; b++)
				{
					if (Math.random() > 0)
					{
						if (nBranch > 1e5)
							break;
						Point startN = branch.getEnd();
						double branchesAngleN = branchesAngle / (level * 2);
						double phi = startN.getPhi() - (b * branchesAngleN / (nBranches - 1)) + branchesAngleN / 2
								+ (Math.random() * branchesAngleN * 2 - branchesAngleN);
						if (phi < Math.PI)
							continue;
						Point endN = new Point(rhoN, phi, startN.getX(), startN.getY());
						Branch newBranch = new Branch(startN, endN);
						newBranch.setStyleColor(new Color(level * 20, level * 20, level * 20));
						newBranch.setStyleStrike(1);
						newBranch.setCaps(true);
						newBranch.setStyleCapsColor(new Color(255, level * 20, level * 20));
						newBranch.setStyleCapsRadius(2);
						nextLevel.add(newBranch);
						nBr++;
					}
				}
				nBranch++;

			}
			System.out.println(nBranch);
			tree.getBranches().put(level, nextLevel);
		}

		ArrayList<IswgShape> shapes = new ArrayList<IswgShape>();
		shapes.add(tree);
		MakeSVGFile a = new MakeSVGFile(standardPath + "treeNew.svg", shapes);
		a.process();
		System.out.println("byE " + nBr);
	}

	private static void trees()
	{
		Point start = new Point(300, 600);
		Point end = new Point(300, 580);

		BranchOLD treeOLD = new BranchOLD(start, end);
		treeOLD.setLevel(0);
		treeOLD.setLengh(1);
		treeOLD.setStyleColor(new Color(0, 0, 0));
		treeOLD.setStyleStrike(2);
		treeOLD.setCaps(true);
		treeOLD.setStyleCapsColor(new Color(255, 0, 0));
		treeOLD.setStyleCapsRadius(2);
		System.out.println(treeOLD);

		double nBranches = 3;
		double branchesAngle = Math.PI / 1.5;

		for (int level = 0; level < 5; level++)
		{
			double rho = 20 * (level + 1);
			if (treeOLD.getLengh() == 1)
			{
				ArrayList<BranchOLD> newLevel = new ArrayList<BranchOLD>();
				for (int b = 0; b < nBranches; b++)
				{
					Point startN = treeOLD.getEnd();
					double phi = treeOLD.getPhi() + b * branchesAngle / nBranches;
					Point endN = new Point(rho, phi, startN.getX(), startN.getY());
					BranchOLD newBranch = new BranchOLD(startN, endN);
					newBranch.setLevel(1);
					newBranch.setLengh(0);
					newBranch.setStyleColor(new Color(0, 0, 0));
					newBranch.setStyleStrike(2);
					newBranch.setCaps(true);
					newBranch.setStyleCapsColor(new Color(255, 0, 0));
					newBranch.setStyleCapsRadius(2);
					newLevel.add(newBranch);
				}
				treeOLD.setBrances(newLevel);
				treeOLD.setLengh(2);
			}
			else
			{

			}
		}

		ArrayList<IswgShape> shapes = new ArrayList<IswgShape>();
		shapes.add(treeOLD);
		MakeSVGFile a = new MakeSVGFile(standardPath + "tree.svg", shapes);
		a.process();
		System.out.println("byE");
	}

	private static void randomWalk1()
	{
		ArrayList<IswgShape> shapes = new ArrayList<IswgShape>();
		int nStep = 5000;
		double xx = 600;
		double yy = 600;
		double rho = 40;
		int border = 50;
		int walk = 0;
		Point start = new Point((int) xx / 2 + border, (int) yy / 2 + border);
		Circle cc = new Circle(start.getX(), start.getY(), 2, 0, "", "blu");
		shapes.add(cc);
		ArrayList<Point> poly = new ArrayList<Point>();
		poly.add(start);
		double oldphi = 0;
		double gapPhi = (Math.random() * 2 * Math.PI / 360.) * 10.;
		for (int i = 0; i < nStep; i++)
		{
			Point next = poly.get(poly.size() - 1);
			double phi = 0;
			int ttry = 0;
			do
			{
				phi = Math.random() * 2 * Math.PI;
				ttry++;
			}
			while (Math.abs(phi - oldphi) < gapPhi);
			oldphi = phi;

			Polyline temp = null;
			Point p = null;
			ttry = 0;
			do
			{
				double rhoRND = Math.random() * rho + 5;

				int x = (int) (rhoRND * Math.cos(phi) + next.getX());
				int y = (int) (rhoRND * Math.sin(phi) + next.getY());
				if (x < 0 || x > xx || y < 0 || y > yy)
				{
					continue;
				}
				temp = new Polyline("fill:none;stroke:grey;stroke-width:1", poly);
				p = new Point(x, y);

				ttry++;

			}
			while (ttry < 1000 && temp != null && p != null && !temp.intersect(p, 1));

			if (p != null)
			{
				poly.add(p);
				Circle c = new Circle(p.getX(), p.getY(), 2, 0, "", "red");
				shapes.add(c);
				walk++;
				System.out.println(i + " " + "walk:" + walk + " " + p);
			}

		}
		Polyline p = new Polyline("fill:none;stroke:grey;stroke-width:1", poly);
		shapes.add(p);
		MakeSVGFile a = new MakeSVGFile("c:/tmp/randomWalk.svg", shapes);
		a.process();
		System.out.println("byE");
	}

	private static void randomWalk()
	{
		ArrayList<IswgShape> shapes = new ArrayList<IswgShape>();
		int nStep = 5000;
		double xx = 600;
		double yy = 600;
		double rho = 40;
		int border = 50;
		int walk = 0;
		Point start = new Point((int) xx / 2 + border, (int) yy / 2 + border);
		Circle cc = new Circle(start.getX(), start.getY(), 2, 0, "", "blu");
		shapes.add(cc);
		ArrayList<Point> poly = new ArrayList<Point>();
		poly.add(start);
		double oldphi = 0;
		double gapPhi = (Math.random() * 2 * Math.PI / 360.) * 10.;
		for (int i = 0; i < nStep; i++)
		{
			Point next = poly.get(poly.size() - 1);
			double phi = 0;
			int ttry = 0;
			do
			{
				phi = Math.random() * 2 * Math.PI;
				ttry++;
			}
			while (Math.abs(phi - oldphi) < gapPhi);
			oldphi = phi;

			double rhoRND = Math.random() * rho + 5;

			int x = (int) (rhoRND * Math.cos(phi) + next.getX());
			int y = (int) (rhoRND * Math.sin(phi) + next.getY());
			if (x < 0 || x > xx || y < 0 || y > yy)
			{
				continue;
			}
			Polyline temp = new Polyline("fill:none;stroke:grey;stroke-width:1", poly);
			Point p = new Point(x, y);

			if (!temp.intersect(p, 1))
			{
				poly.add(p);
				Circle c = new Circle(p.getX(), p.getY(), 2, 0, "", "red");
				shapes.add(c);
				walk++;
				System.out.println(i + " " + "walk:" + walk + " " + p);
			}
		}
		Polyline p = new Polyline("fill:none;stroke:grey;stroke-width:1", poly);
		shapes.add(p);
		MakeSVGFile a = new MakeSVGFile(standardPath + "randomWalk.svg", shapes);
		a.process();
		System.out.println("byE");
	}

	private static void fillSquare3()
	{

		double xx = 550;
		double yy = 550;
		int rr = 90;
		int n = 0;
		int coll = 0;
		ArrayList<IswgShape> shapes = new ArrayList<IswgShape>();
		for (int r = rr; r > 0; r--)
		{
			n = 0;
			coll = 0;
			RunningTime rt = new RunningTime();
			rt.start();
			int Ntry = 0;
			if (r > 89)
			{
				Ntry = (int) (100000 * xx * yy / (r * r * r * r * Math.PI));
				for (int i = 0; i < Ntry; i++)
				{
					Circle c;

					int x = (int) (Math.random() * xx) + rr;
					int y = (int) (Math.random() * yy) + rr;

					String color = Color.randomGrey(240, 230);
					c = new Circle(x, y, r, 0, "", color);
					if (c.collide(shapes))
					{
						coll++;
						continue;
					}
					n++;
					shapes.add(c);

				}
			}
			else
			{
				Circle c;
				Ntry = (int) (xx / r / 2 * yy / r / 2);
				for (int x = 0; x < xx; x = x + 1)
				{
					for (int y = 0; y < yy; y = y + 1)
					{

						String color = Color.randomGrey(240, 230);
						c = new Circle(x + rr, y + rr, r, 0, "", color);
						if (c.collide(shapes))
						{
							coll++;
							continue;
						}
						n++;
						shapes.add(c);
					}

				}

			}

			rt.stop();
			System.out.println("R:" + r + " crf:" + n + " skipped:" + coll + " Ntry=" + Ntry + " time:" + rt.getElapsedDescr());
			MakeSVGFile a = new MakeSVGFile(standardPath + "fillSquare3.svg", shapes);
			a.process();
		}

		System.out.println("bye");
	}

	private static void fillSquare2()
	{

		double xx = 500;
		double yy = 500;
		double rr = 100;
		int n = 0;
		int coll = 0;
		ArrayList<IswgShape> shapes = new ArrayList<IswgShape>();
		for (int i = 0; i < 2000000; i++)
		{
			Circle c;

			int x = (int) (Math.random() * xx) + 50;
			int y = (int) (Math.random() * yy) + 50;
			int r = (int) (Math.random() * rr + 4);
			// String color = Color.randomColor();
			String color = Color.randomGrey(240, 230);
			c = new Circle(x, y, r, 0, "", color);

			if (c.collide(shapes))
			{
				coll++;
				continue;
			}
			n++;
			shapes.add(c);
			MakeSVGFile a = new MakeSVGFile(standardPath + "fillSquare2.svg", shapes);
			a.process();
			// System.out.println(n+") "+c);
		}
		System.out.println("crf:" + n + " skipped" + coll);
		MakeSVGFile a = new MakeSVGFile(standardPath + "fillSquare2.svg", shapes);
		a.process();
	}

	private static void fillSquare1()
	{

		double xx = 300;
		double yy = 300;
		double rr = 10;

		ArrayList<IswgShape> shapes = new ArrayList<IswgShape>();
		for (int i = 0; i < 500; i++)
		{
			int x = (int) (Math.random() * xx);
			int y = (int) (Math.random() * yy);
			int r = (int) (Math.random() * rr);
			String color = Color.randomColor();
			Circle c = new Circle(x, y, r, 0, "", color);
			shapes.add(c);
			System.out.println(c);
		}
		MakeSVGFile a = new MakeSVGFile(standardPath + "fillSquare1.svg", shapes);
		a.process();
	}

	private static void spiralLine()
	{
		ArrayList<IswgShape> shapes = new ArrayList<IswgShape>();
		ArrayList<Point> points = new ArrayList<Point>();
		double xx = 300;
		double yy = 300;
		for (int i = 0; i < 200; i++)
		{
			double fi = i * (Math.PI / 40);
			double rho = i;
			int x = (int) (rho * Math.cos(fi) + xx);
			int y = (int) (rho * Math.sin(fi) + yy);
			Point p = new Point(x, y);
			points.add(p);
		}

		Polyline poly = new Polyline("fill:none;stroke:grey;stroke-width:1", points);
		shapes.add(poly);
		System.out.println(poly);

		MakeSVGFile a = new MakeSVGFile(standardPath + "polySpiral.svg", shapes);
		a.process();

	}

	private static void spiral()
	{

		ArrayList<IswgShape> shapes = new ArrayList<IswgShape>();
		double xx = 300;
		double yy = 300;
		for (int i = 0; i < 200; i++)
		{
			double fi = i * (Math.PI / 50);
			double rho = i;
			int x = (int) (rho * Math.cos(fi) + xx);
			int y = (int) (rho * Math.sin(fi) + yy);
			Circle c = new Circle(x, y, 1, 0, "", "red");
			shapes.add(c);
			System.out.println(c);
		}
		MakeSVGFile a = new MakeSVGFile(standardPath + "spiral.svg", shapes);
		a.process();
	}

	public static void test()
	{
		ArrayList<IswgShape> shapes = new ArrayList<IswgShape>();
		Circle c = new Circle(10, 20, 5, 0, "red", "blue");
		System.out.println(c.getSWGCode());
		Circle d = new Circle(100, 200, 5);
		System.out.println(d.getSWGCode());
		shapes.add(c);
		MakeSVGFile a = new MakeSVGFile(standardPath + "test.svg", shapes);
		a.process();
	}
}
